n = int(input("请输入要查找的数的范围："))
for i in range(n+1):
    a = []
    for j in range(1, i):
        if i % j == 0:
            a.append(j)
    if sum(a) == i:
            print(i)
